package jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class JDBCDemo3 {
    public static void main(String[] args) throws Exception {
        Connection connection=DBUtil.getConnection();
        Statement statement = connection.createStatement();
        /*
        update user
        set password='666666',nickname='三三',age=33
        where id =1;
         */
        String sql="update user\n" +
                "        set password='666666',nickname='三三',age=33\n" +
                "        where id =1;";
        int num = statement.executeUpdate(sql);
        if(num>0){
            System.out.println("修改成功");
        }else {
            System.out.println("修改失败");
        }
        connection.close();
    }
}
